package com.itheima_01;

import java.lang.reflect.Constructor;

public class Test01 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class aClass = Class.forName("com.itheima_01.Student");
        Constructor c1 = aClass.getConstructor();
        System.out.println(c1);
        System.out.println("-------------------------------");

        Constructor[] constructors = aClass.getConstructors();
        for (Constructor constructor : constructors) {
            System.out.println(constructor);
        }
        System.out.println("--------------------------------------");
        Constructor c2 = aClass.getDeclaredConstructor(int.class);
        System.out.println(c2);
        System.out.println("----------------------------------");

        Constructor[] declaredConstructors = aClass.getDeclaredConstructors();
        for (Constructor declaredConstructor : declaredConstructors) {
            System.out.println(declaredConstructor);
        }


    }
}
